/*
 * 易族智汇（北京）科技有限公司 版权所有。
 * 未经许可，您不得使用此文件。
 * 官方地址：www.javamall.com.cn
 */
package com.enation.app.javashop.core.client.fallback.trade;

import com.enation.app.javashop.core.client.feignimpl.trade.AfterSaleClientFeignImpl;
import com.enation.app.javashop.core.handler.BaseFallbackFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.enation.app.javashop.model.aftersale.dos.RefundDO;
import com.enation.app.javashop.model.aftersale.vo.ApplyAfterSaleVO;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * 售后client fallback
 * @author kingapex
 * @version 1.0
 * @since 7.1.0
 * 2020/4/9
 */
@Component
public class AfterSaleClientFallbackFactory extends BaseFallbackFactory<AfterSaleClientFeignImpl> implements FallbackFactory {


    @Override
    protected AfterSaleClientFeignImpl fallback() {
        return new AfterSaleClientFallback();
    }

    /**
     * 售后client fallback
     * @author kingapex
     * @version 1.0
     * @since 7.1.0
     * 2020/4/9
     */
    @Component
    public static class AfterSaleClientFallback implements AfterSaleClientFeignImpl {

        protected final Logger logger = LoggerFactory.getLogger(this.getClass());

        @Override
        public void cancelPintuanOrder(String orderSn, String cancelReason) {
            logger.error("售后服务异常，取消拼团订单失败");
        }

        @Override
        public ApplyAfterSaleVO detail(String serviceSn) {
            logger.error("售后服务异常，获取售后服务详细失败");
            return null;
        }

        @Override
        public RefundDO getAfterSaleRefundModel(String serviceSn) {
            logger.error("售后服务异常，获取退款单 调用afterSaleRefundManager.getModel失败");
            return null;
        }

        @Override
        public void refundCompletion() {
            logger.error("售后服务异常，退款完成操作失败");
        }

        @Override
        public void editAfterSaleShopName(Long shopId, String shopName) {
            logger.error("售后服务异常，修改售后服务单中的店铺名称失败");
        }
    }
}
